package storm.bolt;

import org.apache.storm.trident.operation.BaseFilter;
import org.apache.storm.trident.tuple.TridentTuple;

/**
 * Created by luoqifei on 2016/10/12.
 */
//这是storm 的过滤器，重写它is keep方法就可以，这个元组中不符合条件的就就过滤，跳过。true就是要留下这个tuple
public class StormFilterDemo extends BaseFilter {
    public boolean isKeep(TridentTuple tuple) {
        return tuple.getInteger(0) == 1 && tuple.getInteger(1) == 2;
    }

}
